package beans;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
import java.io.Serializable;
import java.util.Collection;

public class Type implements Serializable {

	private static final long serialVersionUID = -2232020959884238900L;
	
	private int numType;
	private String libelle;
	private Collection<Examen> listeExamens;
	private Collection<EC> listeEC;
	private Collection<JNTTypeECEnseignant> listeServices;
	private Collection<Creneau> listeCreneaux;
	private Collection<JNTTypeEC> listeHeuresTheoriques;

	PropertyChangeSupport changeSupport;
	VetoableChangeSupport vetoableSupport;
	
	public Type() {}
	
	public Type(int numType, String libelle) {
		super();
		this.numType = numType;
		this.libelle = libelle;
		this.listeCreneaux = null;
		this.listeEC = null;
		this.listeExamens = null;
		this.listeHeuresTheoriques = null;
		this.listeServices = null;
	}

	public Collection<JNTTypeEC> getListeHeuresTheoriques() {
		return listeHeuresTheoriques;
	}

	public void setListeHeuresTheoriques(Collection<JNTTypeEC> listeHeuresTheoriques) {
		this.listeHeuresTheoriques = listeHeuresTheoriques;
	}
	
	public Collection<Creneau> getListeCreneaux() {
		return listeCreneaux;
	}

	public void setListeCreneaux(Collection<Creneau> listeCreneaux) {
		this.listeCreneaux = listeCreneaux;
	}

	public Collection<JNTTypeECEnseignant> getListeServices() {
		return listeServices;
	}

	public void setListeServices(Collection<JNTTypeECEnseignant> listeServices) {
		this.listeServices = listeServices;
	}
	
	public Collection<Examen> getListeExamens() {
		return listeExamens;
	}

	public void setListeExamens(Collection<Examen> listeExamens) {
		this.listeExamens = listeExamens;
	}

	public Collection<EC> getListeEC() {
		return listeEC;
	}

	public void setListeEC(Collection<EC> listeEC) {
		this.listeEC = listeEC;
	}

	public int getNumType() {
		return numType;
	}
	
	public void setNumType(int numType) {
		this.numType = numType;
	}
	
	public String getLibelle() {
		return libelle;
	}
	
	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}
	
	public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.addPropertyChangeListener(listener);
	}
	
	public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
		changeSupport.removePropertyChangeListener(listener);
	}
	
	public synchronized void addVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.addVetoableChangeListener(listener);
	}
	
	public synchronized void removeVetoableChangeListener(VetoableChangeListener listener) {
		vetoableSupport.removeVetoableChangeListener(listener);
	} 
}
